// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#include <PyVolumeAttributes.h>
#include <ObserverToCallback.h>
#include <stdio.h>
#include <Py2and3Support.h>
#include <PyColorControlPointList.h>
#include <PyGaussianControlPointList.h>

// ****************************************************************************
// Module: PyVolumeAttributes
//
// Purpose:
//   This class contains the plot attributes for the volume plot.
//
// Note:       Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation:   omitted
//
// ****************************************************************************

//
// This struct contains the Python type information and a VolumeAttributes.
//
struct VolumeAttributesObject
{
    PyObject_HEAD
    VolumeAttributes *data;
    bool        owns;
    PyObject   *parent;
};

//
// Internal prototypes
//
static PyObject *NewVolumeAttributes(int);
std::string
PyVolumeAttributes_ToString(const VolumeAttributes *atts, const char *prefix, const bool forLogging)
{
    std::string str;
    char tmpStr[1000];

    if(atts->GetOSPRayEnabledFlag())
        snprintf(tmpStr, 1000, "%sOSPRayEnabledFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRayEnabledFlag = 0\n", prefix);
    str += tmpStr;
    const char *OSPRayRenderType_names = "SciVis, PathTracer";
    switch (atts->GetOSPRayRenderType())
    {
      case VolumeAttributes::SciVis:
          snprintf(tmpStr, 1000, "%sOSPRayRenderType = %sSciVis  # %s\n", prefix, prefix, OSPRayRenderType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::PathTracer:
          snprintf(tmpStr, 1000, "%sOSPRayRenderType = %sPathTracer  # %s\n", prefix, prefix, OSPRayRenderType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetOSPRayShadowsEnabledFlag())
        snprintf(tmpStr, 1000, "%sOSPRayShadowsEnabledFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRayShadowsEnabledFlag = 0\n", prefix);
    str += tmpStr;
    if(atts->GetOSPRayUseGridAcceleratorFlag())
        snprintf(tmpStr, 1000, "%sOSPRayUseGridAcceleratorFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRayUseGridAcceleratorFlag = 0\n", prefix);
    str += tmpStr;
    if(atts->GetOSPRayPreIntegrationFlag())
        snprintf(tmpStr, 1000, "%sOSPRayPreIntegrationFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRayPreIntegrationFlag = 0\n", prefix);
    str += tmpStr;
    if(atts->GetOSPRaySingleShadeFlag())
        snprintf(tmpStr, 1000, "%sOSPRaySingleShadeFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRaySingleShadeFlag = 0\n", prefix);
    str += tmpStr;
    if(atts->GetOSPRayOneSidedLightingFlag())
        snprintf(tmpStr, 1000, "%sOSPRayOneSidedLightingFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRayOneSidedLightingFlag = 0\n", prefix);
    str += tmpStr;
    if(atts->GetOSPRayAOTransparencyEnabledFlag())
        snprintf(tmpStr, 1000, "%sOSPRayAOTransparencyEnabledFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sOSPRayAOTransparencyEnabledFlag = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sOSPRaySPP = %d\n", prefix, atts->GetOSPRaySPP());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sOSPRayAOSamples = %d\n", prefix, atts->GetOSPRayAOSamples());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sOSPRayAODistance = %g\n", prefix, atts->GetOSPRayAODistance());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sOSPRayMinContribution = %g\n", prefix, atts->GetOSPRayMinContribution());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sOSPRayMaxContribution = %g\n", prefix, atts->GetOSPRayMaxContribution());
    str += tmpStr;
    if(atts->GetLegendFlag())
        snprintf(tmpStr, 1000, "%slegendFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%slegendFlag = 0\n", prefix);
    str += tmpStr;
    if(atts->GetLightingFlag())
        snprintf(tmpStr, 1000, "%slightingFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%slightingFlag = 0\n", prefix);
    str += tmpStr;
    { // new scope
        std::string objPrefix(prefix);
        objPrefix += "colorControlPoints.";
        str += PyColorControlPointList_ToString(&atts->GetColorControlPoints(), objPrefix.c_str(), forLogging);
    }
    snprintf(tmpStr, 1000, "%sopacityAttenuation = %g\n", prefix, atts->GetOpacityAttenuation());
    str += tmpStr;
    const char *opacityMode_names = "FreeformMode, GaussianMode, ColorTableMode";
    switch (atts->GetOpacityMode())
    {
      case VolumeAttributes::FreeformMode:
          snprintf(tmpStr, 1000, "%sopacityMode = %sFreeformMode  # %s\n", prefix, prefix, opacityMode_names);
          str += tmpStr;
          break;
      case VolumeAttributes::GaussianMode:
          snprintf(tmpStr, 1000, "%sopacityMode = %sGaussianMode  # %s\n", prefix, prefix, opacityMode_names);
          str += tmpStr;
          break;
      case VolumeAttributes::ColorTableMode:
          snprintf(tmpStr, 1000, "%sopacityMode = %sColorTableMode  # %s\n", prefix, prefix, opacityMode_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    { // new scope
        std::string objPrefix(prefix);
        objPrefix += "opacityControlPoints.";
        str += PyGaussianControlPointList_ToString(&atts->GetOpacityControlPoints(), objPrefix.c_str(), forLogging);
    }
    const char *resampleType_names = "NoResampling, OnlyIfRequired, SingleDomain, ParallelRedistribute, ParallelPerRank";
    switch (atts->GetResampleType())
    {
      case VolumeAttributes::NoResampling:
          snprintf(tmpStr, 1000, "%sresampleType = %sNoResampling  # %s\n", prefix, prefix, resampleType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::OnlyIfRequired:
          snprintf(tmpStr, 1000, "%sresampleType = %sOnlyIfRequired  # %s\n", prefix, prefix, resampleType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::SingleDomain:
          snprintf(tmpStr, 1000, "%sresampleType = %sSingleDomain  # %s\n", prefix, prefix, resampleType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::ParallelRedistribute:
          snprintf(tmpStr, 1000, "%sresampleType = %sParallelRedistribute  # %s\n", prefix, prefix, resampleType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::ParallelPerRank:
          snprintf(tmpStr, 1000, "%sresampleType = %sParallelPerRank  # %s\n", prefix, prefix, resampleType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%sresampleTarget = %d\n", prefix, atts->GetResampleTarget());
    str += tmpStr;
    const char *resampleCentering_names = "NativeCentering, NodalCentering, ZonalCentering";
    switch (atts->GetResampleCentering())
    {
      case VolumeAttributes::NativeCentering:
          snprintf(tmpStr, 1000, "%sresampleCentering = %sNativeCentering  # %s\n", prefix, prefix, resampleCentering_names);
          str += tmpStr;
          break;
      case VolumeAttributes::NodalCentering:
          snprintf(tmpStr, 1000, "%sresampleCentering = %sNodalCentering  # %s\n", prefix, prefix, resampleCentering_names);
          str += tmpStr;
          break;
      case VolumeAttributes::ZonalCentering:
          snprintf(tmpStr, 1000, "%sresampleCentering = %sZonalCentering  # %s\n", prefix, prefix, resampleCentering_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%sopacityVariable = \"%s\"\n", prefix, atts->GetOpacityVariable().c_str());
    str += tmpStr;
    {   const unsigned char *freeformOpacity = atts->GetFreeformOpacity();
        snprintf(tmpStr, 1000, "%sfreeformOpacity = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 256; ++i)
        {
            snprintf(tmpStr, 1000, "%d", int(freeformOpacity[i]));
            str += tmpStr;
            if(i < 255)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    if(atts->GetUseColorVarMin())
        snprintf(tmpStr, 1000, "%suseColorVarMin = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%suseColorVarMin = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%scolorVarMin = %g\n", prefix, atts->GetColorVarMin());
    str += tmpStr;
    if(atts->GetUseColorVarMax())
        snprintf(tmpStr, 1000, "%suseColorVarMax = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%suseColorVarMax = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%scolorVarMax = %g\n", prefix, atts->GetColorVarMax());
    str += tmpStr;
    if(atts->GetUseOpacityVarMin())
        snprintf(tmpStr, 1000, "%suseOpacityVarMin = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%suseOpacityVarMin = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sopacityVarMin = %g\n", prefix, atts->GetOpacityVarMin());
    str += tmpStr;
    if(atts->GetUseOpacityVarMax())
        snprintf(tmpStr, 1000, "%suseOpacityVarMax = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%suseOpacityVarMax = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sopacityVarMax = %g\n", prefix, atts->GetOpacityVarMax());
    str += tmpStr;
    if(atts->GetSmoothData())
        snprintf(tmpStr, 1000, "%ssmoothData = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%ssmoothData = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%ssamplesPerRay = %d\n", prefix, atts->GetSamplesPerRay());
    str += tmpStr;
    const char *rendererType_names = "Serial, Parallel, Composite, Integration, SLIVR";
    switch (atts->GetRendererType())
    {
      case VolumeAttributes::Serial:
          snprintf(tmpStr, 1000, "%srendererType = %sSerial  # %s\n", prefix, prefix, rendererType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Parallel:
          snprintf(tmpStr, 1000, "%srendererType = %sParallel  # %s\n", prefix, prefix, rendererType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Composite:
          snprintf(tmpStr, 1000, "%srendererType = %sComposite  # %s\n", prefix, prefix, rendererType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Integration:
          snprintf(tmpStr, 1000, "%srendererType = %sIntegration  # %s\n", prefix, prefix, rendererType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::SLIVR:
          snprintf(tmpStr, 1000, "%srendererType = %sSLIVR  # %s\n", prefix, prefix, rendererType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *gradientType_names = "CenteredDifferences, SobelOperator";
    switch (atts->GetGradientType())
    {
      case VolumeAttributes::CenteredDifferences:
          snprintf(tmpStr, 1000, "%sgradientType = %sCenteredDifferences  # %s\n", prefix, prefix, gradientType_names);
          str += tmpStr;
          break;
      case VolumeAttributes::SobelOperator:
          snprintf(tmpStr, 1000, "%sgradientType = %sSobelOperator  # %s\n", prefix, prefix, gradientType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *scaling_names = "Linear, Log, Skew";
    switch (atts->GetScaling())
    {
      case VolumeAttributes::Linear:
          snprintf(tmpStr, 1000, "%sscaling = %sLinear  # %s\n", prefix, prefix, scaling_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Log:
          snprintf(tmpStr, 1000, "%sscaling = %sLog  # %s\n", prefix, prefix, scaling_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Skew:
          snprintf(tmpStr, 1000, "%sscaling = %sSkew  # %s\n", prefix, prefix, scaling_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%sskewFactor = %g\n", prefix, atts->GetSkewFactor());
    str += tmpStr;
    const char *limitsMode_names = "OriginalData, CurrentPlot";
    switch (atts->GetLimitsMode())
    {
      case VolumeAttributes::OriginalData:
          snprintf(tmpStr, 1000, "%slimitsMode = %sOriginalData  # %s\n", prefix, prefix, limitsMode_names);
          str += tmpStr;
          break;
      case VolumeAttributes::CurrentPlot:
          snprintf(tmpStr, 1000, "%slimitsMode = %sCurrentPlot  # %s\n", prefix, prefix, limitsMode_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *sampling_names = "KernelBased, Rasterization, Trilinear";
    switch (atts->GetSampling())
    {
      case VolumeAttributes::KernelBased:
          snprintf(tmpStr, 1000, "%ssampling = %sKernelBased  # %s\n", prefix, prefix, sampling_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Rasterization:
          snprintf(tmpStr, 1000, "%ssampling = %sRasterization  # %s\n", prefix, prefix, sampling_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Trilinear:
          snprintf(tmpStr, 1000, "%ssampling = %sTrilinear  # %s\n", prefix, prefix, sampling_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%srendererSamples = %g\n", prefix, atts->GetRendererSamples());
    str += tmpStr;
    const char *lowGradientLightingReduction_names = "Off, Lowest, Lower, Low, Medium, "
        "High, Higher, Highest";
    switch (atts->GetLowGradientLightingReduction())
    {
      case VolumeAttributes::Off:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sOff  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Lowest:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sLowest  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Lower:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sLower  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Low:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sLow  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Medium:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sMedium  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::High:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sHigh  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Higher:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sHigher  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      case VolumeAttributes::Highest:
          snprintf(tmpStr, 1000, "%slowGradientLightingReduction = %sHighest  # %s\n", prefix, prefix, lowGradientLightingReduction_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetLowGradientLightingClampFlag())
        snprintf(tmpStr, 1000, "%slowGradientLightingClampFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%slowGradientLightingClampFlag = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%slowGradientLightingClampValue = %g\n", prefix, atts->GetLowGradientLightingClampValue());
    str += tmpStr;
    {   const double *materialProperties = atts->GetMaterialProperties();
        snprintf(tmpStr, 1000, "%smaterialProperties = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 4; ++i)
        {
            snprintf(tmpStr, 1000, "%g", materialProperties[i]);
            str += tmpStr;
            if(i < 3)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    return str;
}

static PyObject *
VolumeAttributes_Notify(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    obj->data->Notify();
    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayEnabledFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayEnabledFlag in the object.
    obj->data->SetOSPRayEnabledFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayEnabledFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRayEnabledFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayRenderType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 2)
    {
        std::stringstream ss;
        ss << "An invalid OSPRayRenderType value was given." << std::endl;
        ss << "Valid values are in the range [0,1]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " SciVis";
        ss << ", PathTracer";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayRenderType in the object.
    obj->data->SetOSPRayRenderType(VolumeAttributes::OSPRayRenderTypes(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayRenderType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOSPRayRenderType()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayShadowsEnabledFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayShadowsEnabledFlag in the object.
    obj->data->SetOSPRayShadowsEnabledFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayShadowsEnabledFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRayShadowsEnabledFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayUseGridAcceleratorFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayUseGridAcceleratorFlag in the object.
    obj->data->SetOSPRayUseGridAcceleratorFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayUseGridAcceleratorFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRayUseGridAcceleratorFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayPreIntegrationFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayPreIntegrationFlag in the object.
    obj->data->SetOSPRayPreIntegrationFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayPreIntegrationFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRayPreIntegrationFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRaySingleShadeFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRaySingleShadeFlag in the object.
    obj->data->SetOSPRaySingleShadeFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRaySingleShadeFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRaySingleShadeFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayOneSidedLightingFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayOneSidedLightingFlag in the object.
    obj->data->SetOSPRayOneSidedLightingFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayOneSidedLightingFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRayOneSidedLightingFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayAOTransparencyEnabledFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayAOTransparencyEnabledFlag in the object.
    obj->data->SetOSPRayAOTransparencyEnabledFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayAOTransparencyEnabledFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOSPRayAOTransparencyEnabledFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRaySPP(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRaySPP in the object.
    obj->data->SetOSPRaySPP(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRaySPP(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOSPRaySPP()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayAOSamples(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayAOSamples in the object.
    obj->data->SetOSPRayAOSamples(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayAOSamples(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOSPRayAOSamples()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayAODistance(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayAODistance in the object.
    obj->data->SetOSPRayAODistance(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayAODistance(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetOSPRayAODistance());
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayMinContribution(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayMinContribution in the object.
    obj->data->SetOSPRayMinContribution(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayMinContribution(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetOSPRayMinContribution());
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOSPRayMaxContribution(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the OSPRayMaxContribution in the object.
    obj->data->SetOSPRayMaxContribution(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOSPRayMaxContribution(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetOSPRayMaxContribution());
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetLegendFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the legendFlag in the object.
    obj->data->SetLegendFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetLegendFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetLegendFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetLightingFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the lightingFlag in the object.
    obj->data->SetLightingFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetLightingFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetLightingFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetColorControlPoints(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *newValue = NULL;
    if(!PyArg_ParseTuple(args, "O", &newValue))
        return NULL;
    if(!PyColorControlPointList_Check(newValue))
        return PyErr_Format(PyExc_TypeError, "Field colorControlPoints can be set only with ColorControlPointList objects");

    obj->data->SetColorControlPoints(*PyColorControlPointList_FromPyObject(newValue));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetColorControlPoints(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    // Since the new object will point to data owned by this object,
    // we need to increment the reference count.
    Py_INCREF(self);

    PyObject *retval = PyColorControlPointList_Wrap(&obj->data->GetColorControlPoints());
    // Set the object's parent so the reference to the parent can be decref'd
    // when the child goes out of scope.
    PyColorControlPointList_SetParent(retval, self);

    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOpacityAttenuation(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the opacityAttenuation in the object.
    obj->data->SetOpacityAttenuation(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOpacityAttenuation(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetOpacityAttenuation()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOpacityMode(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid opacityMode value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " FreeformMode";
        ss << ", GaussianMode";
        ss << ", ColorTableMode";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the opacityMode in the object.
    obj->data->SetOpacityMode(VolumeAttributes::OpacityModes(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOpacityMode(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOpacityMode()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOpacityControlPoints(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *newValue = NULL;
    if(!PyArg_ParseTuple(args, "O", &newValue))
        return NULL;
    if(!PyGaussianControlPointList_Check(newValue))
        return PyErr_Format(PyExc_TypeError, "Field opacityControlPoints can be set only with GaussianControlPointList objects");

    obj->data->SetOpacityControlPoints(*PyGaussianControlPointList_FromPyObject(newValue));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOpacityControlPoints(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    // Since the new object will point to data owned by this object,
    // we need to increment the reference count.
    Py_INCREF(self);

    PyObject *retval = PyGaussianControlPointList_Wrap(&obj->data->GetOpacityControlPoints());
    // Set the object's parent so the reference to the parent can be decref'd
    // when the child goes out of scope.
    PyGaussianControlPointList_SetParent(retval, self);

    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetResampleType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 5)
    {
        std::stringstream ss;
        ss << "An invalid resampleType value was given." << std::endl;
        ss << "Valid values are in the range [0,4]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " NoResampling";
        ss << ", OnlyIfRequired";
        ss << ", SingleDomain";
        ss << ", ParallelRedistribute";
        ss << ", ParallelPerRank";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the resampleType in the object.
    obj->data->SetResampleType(VolumeAttributes::ResampleType(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetResampleType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetResampleType()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetResampleTarget(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the resampleTarget in the object.
    obj->data->SetResampleTarget(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetResampleTarget(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetResampleTarget()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetResampleCentering(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid resampleCentering value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " NativeCentering";
        ss << ", NodalCentering";
        ss << ", ZonalCentering";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the resampleCentering in the object.
    obj->data->SetResampleCentering(VolumeAttributes::ResampleCentering(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetResampleCentering(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetResampleCentering()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOpacityVariable(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged as first member of a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyUnicode_Check(packaged_args))
            args = packaged_args;
    }

    if (!PyUnicode_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a unicode string");
    }

    char const *val = PyUnicode_AsUTF8(args);
    std::string cval = std::string(val);

    if (val == 0 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as utf8 string");
    }

    Py_XDECREF(packaged_args);

    // Set the opacityVariable in the object.
    obj->data->SetOpacityVariable(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOpacityVariable(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyString_FromString(obj->data->GetOpacityVariable().c_str());
    return retval;
}

// ****************************************************************************
//  Modifications:
//    Kathleen Bonnell, Fri Oct 14 08:24:34 PDT 2005
//    Added custom code, to parse different types of args:
//    (int index, int val) -- sets the opacity value at the specified index
//    (list or tuple object) --  as long as it is numeric and has length
//    of 256, will set the opacity values to the values in the list or tuple.
//
//    Mark C. Miller, Fri Jul 23 14:54:46 PDT 2021
//    Handle args as a "wrapped" tuple or list
// ****************************************************************************

static PyObject *
VolumeAttributes_SetFreeformOpacity(PyObject *self, PyObject *args)
{
//
// THIS METHOD IS CUSTOM CODED!!!!!!.
//
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;
    unsigned char *cvals = obj->data->GetFreeformOpacity();
    int opacity, index;
    if (PyTuple_Check(args) || PyList_Check(args))
    {
        if (PySequence_Size(args) == 2 && PyArg_ParseTuple(args, "ii", &index, &opacity))
        {
            if (index < 0 || index >= 256)
                return PyErr_Format(PyExc_IndexError, "first arg (index) must be in range [0...255]");
            if (opacity < 0 || opacity >= 256)
                return PyErr_Format(PyExc_ValueError, "second arg (opacity) must be in range [0...255]");
            cvals[index] = (unsigned char)(opacity);
        }
        else if (PySequence_Size(args) == 1)
        {
            packaged_args = PySequence_GetItem(args, 0);
            if (PyTuple_Check(packaged_args) || PyList_Check(packaged_args))
            {
                if (PySequence_Size(packaged_args) != 256)
                {
                    Py_XDECREF(packaged_args);
                    return PyErr_Format(PyExc_TypeError, "when setting whole opacity array, "
                        "must pass a list or tuple of 256 values");
                }
                args = packaged_args;
            }
        }
        else if (PySequence_Size(args) != 256)
            return PyErr_Format(PyExc_TypeError, "when setting whole opacity array, must pass 256 values");

        PyErr_Clear();
        for (int i = 0; i < PySequence_Size(args); ++i)
        {
            int c;
            PyObject *item = PySequence_GetItem(args, i);
            if(PyInt_Check(item))
                c = int(PyInt_AS_LONG(item));
            else if(PyFloat_Check(item))
                c = int(PyFloat_AS_DOUBLE(item));
            else if(PyLong_Check(item))
                c = int(PyLong_AsDouble(item));
            else // bad form here, we're err'ing out having possibly already changed cvals
                return PyErr_Format(PyExc_TypeError, "opacity value at index %d not a number.", i);
            Py_DECREF(item);
            if (c < 0 || c >= 256)
                return PyErr_Format(PyExc_ValueError, "opacity value at index %d out of range [0...255].", i);
            cvals[i] = (unsigned char)(c);
       }
    }
    else if (PyArg_ParseTuple(args, "ii", &index, &opacity))
    {
        if (index < 0 || index >= 256)
            return PyErr_Format(PyExc_IndexError, "first arg (index) must be in range [0...255]");
        if (opacity < 0 || opacity >= 256)
            return PyErr_Format(PyExc_ValueError, "second arg (opacity) must be in range [0...255]");
        cvals[index] = (unsigned char)(opacity);
    }
    else
    {
        return NULL;
    }

    Py_XDECREF(packaged_args);

    // Mark the freeformOpacity in the object as modified.
    obj->data->SelectFreeformOpacity();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetFreeformOpacity(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the freeformOpacity.
    PyObject *retval = PyTuple_New(256);
    const unsigned char *freeformOpacity = obj->data->GetFreeformOpacity();
    for(int i = 0; i < 256; ++i)
        PyTuple_SET_ITEM(retval, i, PyInt_FromLong(long(freeformOpacity[i])));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetUseColorVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the useColorVarMin in the object.
    obj->data->SetUseColorVarMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetUseColorVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetUseColorVarMin()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetColorVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the colorVarMin in the object.
    obj->data->SetColorVarMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetColorVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetColorVarMin()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetUseColorVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the useColorVarMax in the object.
    obj->data->SetUseColorVarMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetUseColorVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetUseColorVarMax()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetColorVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the colorVarMax in the object.
    obj->data->SetColorVarMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetColorVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetColorVarMax()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetUseOpacityVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the useOpacityVarMin in the object.
    obj->data->SetUseOpacityVarMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetUseOpacityVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetUseOpacityVarMin()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOpacityVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the opacityVarMin in the object.
    obj->data->SetOpacityVarMin(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOpacityVarMin(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetOpacityVarMin()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetUseOpacityVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the useOpacityVarMax in the object.
    obj->data->SetUseOpacityVarMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetUseOpacityVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetUseOpacityVarMax()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetOpacityVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the opacityVarMax in the object.
    obj->data->SetOpacityVarMax(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetOpacityVarMax(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetOpacityVarMax()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetSmoothData(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the smoothData in the object.
    obj->data->SetSmoothData(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetSmoothData(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetSmoothData()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetSamplesPerRay(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the samplesPerRay in the object.
    obj->data->SetSamplesPerRay(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetSamplesPerRay(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetSamplesPerRay()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetRendererType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 5)
    {
        std::stringstream ss;
        ss << "An invalid rendererType value was given." << std::endl;
        ss << "Valid values are in the range [0,4]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Serial";
        ss << ", Parallel";
        ss << ", Composite";
        ss << ", Integration";
        ss << ", SLIVR";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the rendererType in the object.
    obj->data->SetRendererType(VolumeAttributes::Renderer(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetRendererType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetRendererType()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetGradientType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 2)
    {
        std::stringstream ss;
        ss << "An invalid gradientType value was given." << std::endl;
        ss << "Valid values are in the range [0,1]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " CenteredDifferences";
        ss << ", SobelOperator";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the gradientType in the object.
    obj->data->SetGradientType(VolumeAttributes::GradientType(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetGradientType(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetGradientType()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetScaling(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid scaling value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Linear";
        ss << ", Log";
        ss << ", Skew";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the scaling in the object.
    obj->data->SetScaling(VolumeAttributes::Scaling(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetScaling(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetScaling()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetSkewFactor(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the skewFactor in the object.
    obj->data->SetSkewFactor(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetSkewFactor(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetSkewFactor());
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetLimitsMode(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 2)
    {
        std::stringstream ss;
        ss << "An invalid limitsMode value was given." << std::endl;
        ss << "Valid values are in the range [0,1]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " OriginalData";
        ss << ", CurrentPlot";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the limitsMode in the object.
    obj->data->SetLimitsMode(VolumeAttributes::LimitsMode(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetLimitsMode(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetLimitsMode()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetSampling(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid sampling value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " KernelBased";
        ss << ", Rasterization";
        ss << ", Trilinear";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the sampling in the object.
    obj->data->SetSampling(VolumeAttributes::SamplingType(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetSampling(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetSampling()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetRendererSamples(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the rendererSamples in the object.
    obj->data->SetRendererSamples(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetRendererSamples(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetRendererSamples()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetLowGradientLightingReduction(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 8)
    {
        std::stringstream ss;
        ss << "An invalid lowGradientLightingReduction value was given." << std::endl;
        ss << "Valid values are in the range [0,7]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Off";
        ss << ", Lowest";
        ss << ", Lower";
        ss << ", Low";
        ss << ", Medium";
        ss << ", High";
        ss << ", Higher";
        ss << ", Highest";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the lowGradientLightingReduction in the object.
    obj->data->SetLowGradientLightingReduction(VolumeAttributes::LowGradientLightingReduction(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetLowGradientLightingReduction(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetLowGradientLightingReduction()));
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetLowGradientLightingClampFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the lowGradientLightingClampFlag in the object.
    obj->data->SetLowGradientLightingClampFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetLowGradientLightingClampFlag(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetLowGradientLightingClampFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
VolumeAttributes_SetLowGradientLightingClampValue(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the lowGradientLightingClampValue in the object.
    obj->data->SetLowGradientLightingClampValue(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetLowGradientLightingClampValue(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetLowGradientLightingClampValue());
    return retval;
}


/*static*/ PyObject *
VolumeAttributes_SetMaterialProperties(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;

    double *dvals = obj->data->GetMaterialProperties();
    if(!PyArg_ParseTuple(args, "dddd", &dvals[0], &dvals[1], &dvals[2], &dvals[3]))
    {
        PyObject     *tuple;
        if(!PyArg_ParseTuple(args, "O", &tuple))
            return NULL;

        if(PyTuple_Check(tuple))
        {
            if(PyTuple_Size(tuple) != 4)
                return PyErr_Format(PyExc_TypeError, "Expecting 4 double args or tuple thereof.");

            PyErr_Clear();
            for(int i = 0; i < PyTuple_Size(tuple); ++i)
            {
                PyObject *item = PyTuple_GET_ITEM(tuple, i);
                if(PyFloat_Check(item))
                    dvals[i] = PyFloat_AS_DOUBLE(item);
                else if(PyInt_Check(item))
                    dvals[i] = double(PyInt_AS_LONG(item));
                else if(PyLong_Check(item))
                    dvals[i] = PyLong_AsDouble(item);
                else
                    dvals[i] = 0.;
            }
        }
        else
            return NULL;
    }

    // Mark the materialProperties in the object as modified.
    obj->data->SelectMaterialProperties();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
VolumeAttributes_GetMaterialProperties(PyObject *self, PyObject *args)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the materialProperties.
    PyObject *retval = PyTuple_New(4);
    const double *materialProperties = obj->data->GetMaterialProperties();
    for(int i = 0; i < 4; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(materialProperties[i]));
    return retval;
}



PyMethodDef PyVolumeAttributes_methods[VOLUMEATTRIBUTES_NMETH] = {
    {"Notify", VolumeAttributes_Notify, METH_VARARGS},
    {"SetOSPRayEnabledFlag", VolumeAttributes_SetOSPRayEnabledFlag, METH_VARARGS},
    {"GetOSPRayEnabledFlag", VolumeAttributes_GetOSPRayEnabledFlag, METH_VARARGS},
    {"SetOSPRayRenderType", VolumeAttributes_SetOSPRayRenderType, METH_VARARGS},
    {"GetOSPRayRenderType", VolumeAttributes_GetOSPRayRenderType, METH_VARARGS},
    {"SetOSPRayShadowsEnabledFlag", VolumeAttributes_SetOSPRayShadowsEnabledFlag, METH_VARARGS},
    {"GetOSPRayShadowsEnabledFlag", VolumeAttributes_GetOSPRayShadowsEnabledFlag, METH_VARARGS},
    {"SetOSPRayUseGridAcceleratorFlag", VolumeAttributes_SetOSPRayUseGridAcceleratorFlag, METH_VARARGS},
    {"GetOSPRayUseGridAcceleratorFlag", VolumeAttributes_GetOSPRayUseGridAcceleratorFlag, METH_VARARGS},
    {"SetOSPRayPreIntegrationFlag", VolumeAttributes_SetOSPRayPreIntegrationFlag, METH_VARARGS},
    {"GetOSPRayPreIntegrationFlag", VolumeAttributes_GetOSPRayPreIntegrationFlag, METH_VARARGS},
    {"SetOSPRaySingleShadeFlag", VolumeAttributes_SetOSPRaySingleShadeFlag, METH_VARARGS},
    {"GetOSPRaySingleShadeFlag", VolumeAttributes_GetOSPRaySingleShadeFlag, METH_VARARGS},
    {"SetOSPRayOneSidedLightingFlag", VolumeAttributes_SetOSPRayOneSidedLightingFlag, METH_VARARGS},
    {"GetOSPRayOneSidedLightingFlag", VolumeAttributes_GetOSPRayOneSidedLightingFlag, METH_VARARGS},
    {"SetOSPRayAOTransparencyEnabledFlag", VolumeAttributes_SetOSPRayAOTransparencyEnabledFlag, METH_VARARGS},
    {"GetOSPRayAOTransparencyEnabledFlag", VolumeAttributes_GetOSPRayAOTransparencyEnabledFlag, METH_VARARGS},
    {"SetOSPRaySPP", VolumeAttributes_SetOSPRaySPP, METH_VARARGS},
    {"GetOSPRaySPP", VolumeAttributes_GetOSPRaySPP, METH_VARARGS},
    {"SetOSPRayAOSamples", VolumeAttributes_SetOSPRayAOSamples, METH_VARARGS},
    {"GetOSPRayAOSamples", VolumeAttributes_GetOSPRayAOSamples, METH_VARARGS},
    {"SetOSPRayAODistance", VolumeAttributes_SetOSPRayAODistance, METH_VARARGS},
    {"GetOSPRayAODistance", VolumeAttributes_GetOSPRayAODistance, METH_VARARGS},
    {"SetOSPRayMinContribution", VolumeAttributes_SetOSPRayMinContribution, METH_VARARGS},
    {"GetOSPRayMinContribution", VolumeAttributes_GetOSPRayMinContribution, METH_VARARGS},
    {"SetOSPRayMaxContribution", VolumeAttributes_SetOSPRayMaxContribution, METH_VARARGS},
    {"GetOSPRayMaxContribution", VolumeAttributes_GetOSPRayMaxContribution, METH_VARARGS},
    {"SetLegendFlag", VolumeAttributes_SetLegendFlag, METH_VARARGS},
    {"GetLegendFlag", VolumeAttributes_GetLegendFlag, METH_VARARGS},
    {"SetLightingFlag", VolumeAttributes_SetLightingFlag, METH_VARARGS},
    {"GetLightingFlag", VolumeAttributes_GetLightingFlag, METH_VARARGS},
    {"SetColorControlPoints", VolumeAttributes_SetColorControlPoints, METH_VARARGS},
    {"GetColorControlPoints", VolumeAttributes_GetColorControlPoints, METH_VARARGS},
    {"SetOpacityAttenuation", VolumeAttributes_SetOpacityAttenuation, METH_VARARGS},
    {"GetOpacityAttenuation", VolumeAttributes_GetOpacityAttenuation, METH_VARARGS},
    {"SetOpacityMode", VolumeAttributes_SetOpacityMode, METH_VARARGS},
    {"GetOpacityMode", VolumeAttributes_GetOpacityMode, METH_VARARGS},
    {"SetOpacityControlPoints", VolumeAttributes_SetOpacityControlPoints, METH_VARARGS},
    {"GetOpacityControlPoints", VolumeAttributes_GetOpacityControlPoints, METH_VARARGS},
    {"SetResampleType", VolumeAttributes_SetResampleType, METH_VARARGS},
    {"GetResampleType", VolumeAttributes_GetResampleType, METH_VARARGS},
    {"SetResampleTarget", VolumeAttributes_SetResampleTarget, METH_VARARGS},
    {"GetResampleTarget", VolumeAttributes_GetResampleTarget, METH_VARARGS},
    {"SetResampleCentering", VolumeAttributes_SetResampleCentering, METH_VARARGS},
    {"GetResampleCentering", VolumeAttributes_GetResampleCentering, METH_VARARGS},
    {"SetOpacityVariable", VolumeAttributes_SetOpacityVariable, METH_VARARGS},
    {"GetOpacityVariable", VolumeAttributes_GetOpacityVariable, METH_VARARGS},
    {"SetFreeformOpacity", VolumeAttributes_SetFreeformOpacity, METH_VARARGS},
    {"GetFreeformOpacity", VolumeAttributes_GetFreeformOpacity, METH_VARARGS},
    {"SetUseColorVarMin", VolumeAttributes_SetUseColorVarMin, METH_VARARGS},
    {"GetUseColorVarMin", VolumeAttributes_GetUseColorVarMin, METH_VARARGS},
    {"SetColorVarMin", VolumeAttributes_SetColorVarMin, METH_VARARGS},
    {"GetColorVarMin", VolumeAttributes_GetColorVarMin, METH_VARARGS},
    {"SetUseColorVarMax", VolumeAttributes_SetUseColorVarMax, METH_VARARGS},
    {"GetUseColorVarMax", VolumeAttributes_GetUseColorVarMax, METH_VARARGS},
    {"SetColorVarMax", VolumeAttributes_SetColorVarMax, METH_VARARGS},
    {"GetColorVarMax", VolumeAttributes_GetColorVarMax, METH_VARARGS},
    {"SetUseOpacityVarMin", VolumeAttributes_SetUseOpacityVarMin, METH_VARARGS},
    {"GetUseOpacityVarMin", VolumeAttributes_GetUseOpacityVarMin, METH_VARARGS},
    {"SetOpacityVarMin", VolumeAttributes_SetOpacityVarMin, METH_VARARGS},
    {"GetOpacityVarMin", VolumeAttributes_GetOpacityVarMin, METH_VARARGS},
    {"SetUseOpacityVarMax", VolumeAttributes_SetUseOpacityVarMax, METH_VARARGS},
    {"GetUseOpacityVarMax", VolumeAttributes_GetUseOpacityVarMax, METH_VARARGS},
    {"SetOpacityVarMax", VolumeAttributes_SetOpacityVarMax, METH_VARARGS},
    {"GetOpacityVarMax", VolumeAttributes_GetOpacityVarMax, METH_VARARGS},
    {"SetSmoothData", VolumeAttributes_SetSmoothData, METH_VARARGS},
    {"GetSmoothData", VolumeAttributes_GetSmoothData, METH_VARARGS},
    {"SetSamplesPerRay", VolumeAttributes_SetSamplesPerRay, METH_VARARGS},
    {"GetSamplesPerRay", VolumeAttributes_GetSamplesPerRay, METH_VARARGS},
    {"SetRendererType", VolumeAttributes_SetRendererType, METH_VARARGS},
    {"GetRendererType", VolumeAttributes_GetRendererType, METH_VARARGS},
    {"SetGradientType", VolumeAttributes_SetGradientType, METH_VARARGS},
    {"GetGradientType", VolumeAttributes_GetGradientType, METH_VARARGS},
    {"SetScaling", VolumeAttributes_SetScaling, METH_VARARGS},
    {"GetScaling", VolumeAttributes_GetScaling, METH_VARARGS},
    {"SetSkewFactor", VolumeAttributes_SetSkewFactor, METH_VARARGS},
    {"GetSkewFactor", VolumeAttributes_GetSkewFactor, METH_VARARGS},
    {"SetLimitsMode", VolumeAttributes_SetLimitsMode, METH_VARARGS},
    {"GetLimitsMode", VolumeAttributes_GetLimitsMode, METH_VARARGS},
    {"SetSampling", VolumeAttributes_SetSampling, METH_VARARGS},
    {"GetSampling", VolumeAttributes_GetSampling, METH_VARARGS},
    {"SetRendererSamples", VolumeAttributes_SetRendererSamples, METH_VARARGS},
    {"GetRendererSamples", VolumeAttributes_GetRendererSamples, METH_VARARGS},
    {"SetLowGradientLightingReduction", VolumeAttributes_SetLowGradientLightingReduction, METH_VARARGS},
    {"GetLowGradientLightingReduction", VolumeAttributes_GetLowGradientLightingReduction, METH_VARARGS},
    {"SetLowGradientLightingClampFlag", VolumeAttributes_SetLowGradientLightingClampFlag, METH_VARARGS},
    {"GetLowGradientLightingClampFlag", VolumeAttributes_GetLowGradientLightingClampFlag, METH_VARARGS},
    {"SetLowGradientLightingClampValue", VolumeAttributes_SetLowGradientLightingClampValue, METH_VARARGS},
    {"GetLowGradientLightingClampValue", VolumeAttributes_GetLowGradientLightingClampValue, METH_VARARGS},
    {"SetMaterialProperties", VolumeAttributes_SetMaterialProperties, METH_VARARGS},
    {"GetMaterialProperties", VolumeAttributes_GetMaterialProperties, METH_VARARGS},
    {NULL, NULL}
};

//
// Type functions
//

static void
VolumeAttributes_dealloc(PyObject *v)
{
   VolumeAttributesObject *obj = (VolumeAttributesObject *)v;
   if(obj->parent != 0)
       Py_DECREF(obj->parent);
   if(obj->owns)
       delete obj->data;
}

static PyObject *VolumeAttributes_richcompare(PyObject *self, PyObject *other, int op);
PyObject *
PyVolumeAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "OSPRayEnabledFlag") == 0)
        return VolumeAttributes_GetOSPRayEnabledFlag(self, NULL);
    if(strcmp(name, "OSPRayRenderType") == 0)
        return VolumeAttributes_GetOSPRayRenderType(self, NULL);
    if(strcmp(name, "SciVis") == 0)
        return PyInt_FromLong(long(VolumeAttributes::SciVis));
    if(strcmp(name, "PathTracer") == 0)
        return PyInt_FromLong(long(VolumeAttributes::PathTracer));

    if(strcmp(name, "OSPRayShadowsEnabledFlag") == 0)
        return VolumeAttributes_GetOSPRayShadowsEnabledFlag(self, NULL);
    if(strcmp(name, "OSPRayUseGridAcceleratorFlag") == 0)
        return VolumeAttributes_GetOSPRayUseGridAcceleratorFlag(self, NULL);
    if(strcmp(name, "OSPRayPreIntegrationFlag") == 0)
        return VolumeAttributes_GetOSPRayPreIntegrationFlag(self, NULL);
    if(strcmp(name, "OSPRaySingleShadeFlag") == 0)
        return VolumeAttributes_GetOSPRaySingleShadeFlag(self, NULL);
    if(strcmp(name, "OSPRayOneSidedLightingFlag") == 0)
        return VolumeAttributes_GetOSPRayOneSidedLightingFlag(self, NULL);
    if(strcmp(name, "OSPRayAOTransparencyEnabledFlag") == 0)
        return VolumeAttributes_GetOSPRayAOTransparencyEnabledFlag(self, NULL);
    if(strcmp(name, "OSPRaySPP") == 0)
        return VolumeAttributes_GetOSPRaySPP(self, NULL);
    if(strcmp(name, "OSPRayAOSamples") == 0)
        return VolumeAttributes_GetOSPRayAOSamples(self, NULL);
    if(strcmp(name, "OSPRayAODistance") == 0)
        return VolumeAttributes_GetOSPRayAODistance(self, NULL);
    if(strcmp(name, "OSPRayMinContribution") == 0)
        return VolumeAttributes_GetOSPRayMinContribution(self, NULL);
    if(strcmp(name, "OSPRayMaxContribution") == 0)
        return VolumeAttributes_GetOSPRayMaxContribution(self, NULL);
    if(strcmp(name, "legendFlag") == 0)
        return VolumeAttributes_GetLegendFlag(self, NULL);
    if(strcmp(name, "lightingFlag") == 0)
        return VolumeAttributes_GetLightingFlag(self, NULL);
    if(strcmp(name, "colorControlPoints") == 0)
        return VolumeAttributes_GetColorControlPoints(self, NULL);
    if(strcmp(name, "opacityAttenuation") == 0)
        return VolumeAttributes_GetOpacityAttenuation(self, NULL);
    if(strcmp(name, "opacityMode") == 0)
        return VolumeAttributes_GetOpacityMode(self, NULL);
    if(strcmp(name, "FreeformMode") == 0)
        return PyInt_FromLong(long(VolumeAttributes::FreeformMode));
    if(strcmp(name, "GaussianMode") == 0)
        return PyInt_FromLong(long(VolumeAttributes::GaussianMode));
    if(strcmp(name, "ColorTableMode") == 0)
        return PyInt_FromLong(long(VolumeAttributes::ColorTableMode));

    if(strcmp(name, "opacityControlPoints") == 0)
        return VolumeAttributes_GetOpacityControlPoints(self, NULL);
    if(strcmp(name, "resampleType") == 0)
        return VolumeAttributes_GetResampleType(self, NULL);
    if(strcmp(name, "NoResampling") == 0)
        return PyInt_FromLong(long(VolumeAttributes::NoResampling));
    if(strcmp(name, "OnlyIfRequired") == 0)
        return PyInt_FromLong(long(VolumeAttributes::OnlyIfRequired));
    if(strcmp(name, "SingleDomain") == 0)
        return PyInt_FromLong(long(VolumeAttributes::SingleDomain));
    if(strcmp(name, "ParallelRedistribute") == 0)
        return PyInt_FromLong(long(VolumeAttributes::ParallelRedistribute));
    if(strcmp(name, "ParallelPerRank") == 0)
        return PyInt_FromLong(long(VolumeAttributes::ParallelPerRank));

    if(strcmp(name, "resampleTarget") == 0)
        return VolumeAttributes_GetResampleTarget(self, NULL);
    if(strcmp(name, "resampleCentering") == 0)
        return VolumeAttributes_GetResampleCentering(self, NULL);
    if(strcmp(name, "NativeCentering") == 0)
        return PyInt_FromLong(long(VolumeAttributes::NativeCentering));
    if(strcmp(name, "NodalCentering") == 0)
        return PyInt_FromLong(long(VolumeAttributes::NodalCentering));
    if(strcmp(name, "ZonalCentering") == 0)
        return PyInt_FromLong(long(VolumeAttributes::ZonalCentering));

    if(strcmp(name, "opacityVariable") == 0)
        return VolumeAttributes_GetOpacityVariable(self, NULL);
    if(strcmp(name, "freeformOpacity") == 0)
        return VolumeAttributes_GetFreeformOpacity(self, NULL);
    if(strcmp(name, "useColorVarMin") == 0)
        return VolumeAttributes_GetUseColorVarMin(self, NULL);
    if(strcmp(name, "colorVarMin") == 0)
        return VolumeAttributes_GetColorVarMin(self, NULL);
    if(strcmp(name, "useColorVarMax") == 0)
        return VolumeAttributes_GetUseColorVarMax(self, NULL);
    if(strcmp(name, "colorVarMax") == 0)
        return VolumeAttributes_GetColorVarMax(self, NULL);
    if(strcmp(name, "useOpacityVarMin") == 0)
        return VolumeAttributes_GetUseOpacityVarMin(self, NULL);
    if(strcmp(name, "opacityVarMin") == 0)
        return VolumeAttributes_GetOpacityVarMin(self, NULL);
    if(strcmp(name, "useOpacityVarMax") == 0)
        return VolumeAttributes_GetUseOpacityVarMax(self, NULL);
    if(strcmp(name, "opacityVarMax") == 0)
        return VolumeAttributes_GetOpacityVarMax(self, NULL);
    if(strcmp(name, "smoothData") == 0)
        return VolumeAttributes_GetSmoothData(self, NULL);
    if(strcmp(name, "samplesPerRay") == 0)
        return VolumeAttributes_GetSamplesPerRay(self, NULL);
    if(strcmp(name, "rendererType") == 0)
        return VolumeAttributes_GetRendererType(self, NULL);
    if(strcmp(name, "Serial") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Serial));
    if(strcmp(name, "Parallel") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Parallel));
    if(strcmp(name, "Composite") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Composite));
    if(strcmp(name, "Integration") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Integration));
    if(strcmp(name, "SLIVR") == 0)
        return PyInt_FromLong(long(VolumeAttributes::SLIVR));

    if(strcmp(name, "gradientType") == 0)
        return VolumeAttributes_GetGradientType(self, NULL);
    if(strcmp(name, "CenteredDifferences") == 0)
        return PyInt_FromLong(long(VolumeAttributes::CenteredDifferences));
    if(strcmp(name, "SobelOperator") == 0)
        return PyInt_FromLong(long(VolumeAttributes::SobelOperator));

    if(strcmp(name, "scaling") == 0)
        return VolumeAttributes_GetScaling(self, NULL);
    if(strcmp(name, "Linear") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Linear));
    if(strcmp(name, "Log") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Log));
    if(strcmp(name, "Skew") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Skew));

    if(strcmp(name, "skewFactor") == 0)
        return VolumeAttributes_GetSkewFactor(self, NULL);
    if(strcmp(name, "limitsMode") == 0)
        return VolumeAttributes_GetLimitsMode(self, NULL);
    if(strcmp(name, "OriginalData") == 0)
        return PyInt_FromLong(long(VolumeAttributes::OriginalData));
    if(strcmp(name, "CurrentPlot") == 0)
        return PyInt_FromLong(long(VolumeAttributes::CurrentPlot));

    if(strcmp(name, "sampling") == 0)
        return VolumeAttributes_GetSampling(self, NULL);
    if(strcmp(name, "KernelBased") == 0)
        return PyInt_FromLong(long(VolumeAttributes::KernelBased));
    if(strcmp(name, "Rasterization") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Rasterization));
    if(strcmp(name, "Trilinear") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Trilinear));

    if(strcmp(name, "rendererSamples") == 0)
        return VolumeAttributes_GetRendererSamples(self, NULL);
    if(strcmp(name, "lowGradientLightingReduction") == 0)
        return VolumeAttributes_GetLowGradientLightingReduction(self, NULL);
    if(strcmp(name, "Off") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Off));
    if(strcmp(name, "Lowest") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Lowest));
    if(strcmp(name, "Lower") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Lower));
    if(strcmp(name, "Low") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Low));
    if(strcmp(name, "Medium") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Medium));
    if(strcmp(name, "High") == 0)
        return PyInt_FromLong(long(VolumeAttributes::High));
    if(strcmp(name, "Higher") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Higher));
    if(strcmp(name, "Highest") == 0)
        return PyInt_FromLong(long(VolumeAttributes::Highest));

    if(strcmp(name, "lowGradientLightingClampFlag") == 0)
        return VolumeAttributes_GetLowGradientLightingClampFlag(self, NULL);
    if(strcmp(name, "lowGradientLightingClampValue") == 0)
        return VolumeAttributes_GetLowGradientLightingClampValue(self, NULL);
    if(strcmp(name, "materialProperties") == 0)
        return VolumeAttributes_GetMaterialProperties(self, NULL);

#include <visit-config.h>

#if VISIT_OBSOLETE_AT_VERSION(3,5,0)
#error This code is obsolete in this version of VisIt and should be removed.
#else
    // Try and handle legacy fields
#define NAME_CHANGE_MESSAGE2(oldname, newname) \
    PyErr_WarnFormat(NULL, 1, "'%s' is no longer a valid Volume attribute.\n" \
                    "It's name has been changed to '%s', " \
                    "please update your script.\n", oldname, newname);

    // rendererTypes
    if(strcmp(name, "Default") == 0)
    {
        NAME_CHANGE_MESSAGE2(name, "Serial");
        return PyInt_FromLong(0L);
    }
    if(strcmp(name, "RayCasting") == 0)
    {
        NAME_CHANGE_MESSAGE2(name, "Composite");
        return PyInt_FromLong(0L);
    }
    if(strcmp(name, "RayCastingIntegration") == 0)
    {
        NAME_CHANGE_MESSAGE2(name, "Integration");
        return PyInt_FromLong(0L);
    }
    if(strcmp(name, "RayCastingSLIVR") == 0)
    {
        NAME_CHANGE_MESSAGE2(name, "SLIVR");
        return PyInt_FromLong(0L);
    }
    if(strcmp(name, "RayCastingOSPRay") == 0)
    {
        PyErr_WarnFormat(NULL, 1, "'RayCastingOSPRay is no longer a valid Volume attribute.\nIt's value is being ignored, please remove it from your script.\nTry using 'Parallel' for 'rendererType' and set 'OSPRayEnabledFlag' to '1'\n");
        return PyInt_FromLong(0L);
    }
    // end Renderer types
#endif

    // Add a __dict__ answer so that dir() works
    if (!strcmp(name, "__dict__"))
    {
        PyObject *result = PyDict_New();
        for (int i = 0; PyVolumeAttributes_methods[i].ml_meth; i++)
            PyDict_SetItem(result,
                PyString_FromString(PyVolumeAttributes_methods[i].ml_name),
                PyString_FromString(PyVolumeAttributes_methods[i].ml_name));
        return result;
    }

    return Py_FindMethod(PyVolumeAttributes_methods, self, name);
}

int
PyVolumeAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
    PyObject NULL_PY_OBJ;
    PyObject *obj = &NULL_PY_OBJ;

    if(strcmp(name, "OSPRayEnabledFlag") == 0)
        obj = VolumeAttributes_SetOSPRayEnabledFlag(self, args);
    else if(strcmp(name, "OSPRayRenderType") == 0)
        obj = VolumeAttributes_SetOSPRayRenderType(self, args);
    else if(strcmp(name, "OSPRayShadowsEnabledFlag") == 0)
        obj = VolumeAttributes_SetOSPRayShadowsEnabledFlag(self, args);
    else if(strcmp(name, "OSPRayUseGridAcceleratorFlag") == 0)
        obj = VolumeAttributes_SetOSPRayUseGridAcceleratorFlag(self, args);
    else if(strcmp(name, "OSPRayPreIntegrationFlag") == 0)
        obj = VolumeAttributes_SetOSPRayPreIntegrationFlag(self, args);
    else if(strcmp(name, "OSPRaySingleShadeFlag") == 0)
        obj = VolumeAttributes_SetOSPRaySingleShadeFlag(self, args);
    else if(strcmp(name, "OSPRayOneSidedLightingFlag") == 0)
        obj = VolumeAttributes_SetOSPRayOneSidedLightingFlag(self, args);
    else if(strcmp(name, "OSPRayAOTransparencyEnabledFlag") == 0)
        obj = VolumeAttributes_SetOSPRayAOTransparencyEnabledFlag(self, args);
    else if(strcmp(name, "OSPRaySPP") == 0)
        obj = VolumeAttributes_SetOSPRaySPP(self, args);
    else if(strcmp(name, "OSPRayAOSamples") == 0)
        obj = VolumeAttributes_SetOSPRayAOSamples(self, args);
    else if(strcmp(name, "OSPRayAODistance") == 0)
        obj = VolumeAttributes_SetOSPRayAODistance(self, args);
    else if(strcmp(name, "OSPRayMinContribution") == 0)
        obj = VolumeAttributes_SetOSPRayMinContribution(self, args);
    else if(strcmp(name, "OSPRayMaxContribution") == 0)
        obj = VolumeAttributes_SetOSPRayMaxContribution(self, args);
    else if(strcmp(name, "legendFlag") == 0)
        obj = VolumeAttributes_SetLegendFlag(self, args);
    else if(strcmp(name, "lightingFlag") == 0)
        obj = VolumeAttributes_SetLightingFlag(self, args);
    else if(strcmp(name, "colorControlPoints") == 0)
        obj = VolumeAttributes_SetColorControlPoints(self, args);
    else if(strcmp(name, "opacityAttenuation") == 0)
        obj = VolumeAttributes_SetOpacityAttenuation(self, args);
    else if(strcmp(name, "opacityMode") == 0)
        obj = VolumeAttributes_SetOpacityMode(self, args);
    else if(strcmp(name, "opacityControlPoints") == 0)
        obj = VolumeAttributes_SetOpacityControlPoints(self, args);
    else if(strcmp(name, "resampleType") == 0)
        obj = VolumeAttributes_SetResampleType(self, args);
    else if(strcmp(name, "resampleTarget") == 0)
        obj = VolumeAttributes_SetResampleTarget(self, args);
    else if(strcmp(name, "resampleCentering") == 0)
        obj = VolumeAttributes_SetResampleCentering(self, args);
    else if(strcmp(name, "opacityVariable") == 0)
        obj = VolumeAttributes_SetOpacityVariable(self, args);
    else if(strcmp(name, "freeformOpacity") == 0)
        obj = VolumeAttributes_SetFreeformOpacity(self, args);
    else if(strcmp(name, "useColorVarMin") == 0)
        obj = VolumeAttributes_SetUseColorVarMin(self, args);
    else if(strcmp(name, "colorVarMin") == 0)
        obj = VolumeAttributes_SetColorVarMin(self, args);
    else if(strcmp(name, "useColorVarMax") == 0)
        obj = VolumeAttributes_SetUseColorVarMax(self, args);
    else if(strcmp(name, "colorVarMax") == 0)
        obj = VolumeAttributes_SetColorVarMax(self, args);
    else if(strcmp(name, "useOpacityVarMin") == 0)
        obj = VolumeAttributes_SetUseOpacityVarMin(self, args);
    else if(strcmp(name, "opacityVarMin") == 0)
        obj = VolumeAttributes_SetOpacityVarMin(self, args);
    else if(strcmp(name, "useOpacityVarMax") == 0)
        obj = VolumeAttributes_SetUseOpacityVarMax(self, args);
    else if(strcmp(name, "opacityVarMax") == 0)
        obj = VolumeAttributes_SetOpacityVarMax(self, args);
    else if(strcmp(name, "smoothData") == 0)
        obj = VolumeAttributes_SetSmoothData(self, args);
    else if(strcmp(name, "samplesPerRay") == 0)
        obj = VolumeAttributes_SetSamplesPerRay(self, args);
    else if(strcmp(name, "rendererType") == 0)
        obj = VolumeAttributes_SetRendererType(self, args);
    else if(strcmp(name, "gradientType") == 0)
        obj = VolumeAttributes_SetGradientType(self, args);
    else if(strcmp(name, "scaling") == 0)
        obj = VolumeAttributes_SetScaling(self, args);
    else if(strcmp(name, "skewFactor") == 0)
        obj = VolumeAttributes_SetSkewFactor(self, args);
    else if(strcmp(name, "limitsMode") == 0)
        obj = VolumeAttributes_SetLimitsMode(self, args);
    else if(strcmp(name, "sampling") == 0)
        obj = VolumeAttributes_SetSampling(self, args);
    else if(strcmp(name, "rendererSamples") == 0)
        obj = VolumeAttributes_SetRendererSamples(self, args);
    else if(strcmp(name, "lowGradientLightingReduction") == 0)
        obj = VolumeAttributes_SetLowGradientLightingReduction(self, args);
    else if(strcmp(name, "lowGradientLightingClampFlag") == 0)
        obj = VolumeAttributes_SetLowGradientLightingClampFlag(self, args);
    else if(strcmp(name, "lowGradientLightingClampValue") == 0)
        obj = VolumeAttributes_SetLowGradientLightingClampValue(self, args);
    else if(strcmp(name, "materialProperties") == 0)
        obj = VolumeAttributes_SetMaterialProperties(self, args);

#if VISIT_OBSOLETE_AT_VERSION(3,5,0)
#error This code is obsolete in this version of VisIt. Please remove it
#else
#define NAME_CHANGE_MESSAGE(oldname, newname) \
    PyErr_WarnFormat(NULL, 1, "'%s' is no longer a valid Volume attribute.\n" \
                    "It's name has been changed to '%s', " \
                    "please update your script.\n", oldname, newname);

#define DEPRECATED_MESSAGE(oldname) \
    PyErr_WarnFormat(NULL, 1, "'%s' is no longer a valid Volume attribute.\n" \
                    "It's value is being ignored, " \
                    "please remove it from your script.\n", oldname);

    // Try and handle legacy fields
    if(obj == &NULL_PY_OBJ)
    {
        if (strcmp(name, "osprayShadowsEnabledFlag") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayShadowsEnabledFlag");
            obj = VolumeAttributes_SetOSPRayShadowsEnabledFlag(self, args);
        }
        else if (strcmp(name, "osprayUseGridAcceleratorFlag") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayUseGridAcceleratorFlag");
            obj = VolumeAttributes_SetOSPRayUseGridAcceleratorFlag(self, args);
        }
        else if (strcmp(name, "osprayPreIntegrationFlag") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayPreIntegrationFlag");
            obj = VolumeAttributes_SetOSPRayPreIntegrationFlag(self, args);
        }
        else if (strcmp(name, "ospraySingleShadeFlag") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRaySingleShadeFlag");
            obj = VolumeAttributes_SetOSPRaySingleShadeFlag(self, args);
        }
        else if (strcmp(name, "osprayOneSidedLightingFlag") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayOneSidedLightingFlag");
            obj = VolumeAttributes_SetOSPRayOneSidedLightingFlag(self, args);
        }
        else if (strcmp(name, "osprayAoTransparencyEnabledFlag") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayAOTransparencyEnabledFlag");
            obj = VolumeAttributes_SetOSPRayAOTransparencyEnabledFlag(self, args);
        }
        else if (strcmp(name, "ospraySpp") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRaySPP");
            obj = VolumeAttributes_SetOSPRaySPP(self, args);
        }
        else if (strcmp(name, "osprayAoSamples") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayAOSamples");
            obj = VolumeAttributes_SetOSPRayAOSamples(self, args);
        }
        else if (strcmp(name, "osprayAoDistance") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayAODistance");
            obj = VolumeAttributes_SetOSPRayAODistance(self, args);
        }
        else if (strcmp(name, "osprayMinContribution") == 0)
        {
            NAME_CHANGE_MESSAGE(name, "OSPRayMinContribution");
            obj = VolumeAttributes_SetOSPRayMinContribution(self, args);
        }

        if ((strcmp(name, "resampleFlag") == 0) ||
            (strcmp(name, "compactVariable") == 0)  ||
            (strcmp(name, "renderMode") == 0))
        {
            DEPRECATED_MESSAGE(name);
            Py_INCREF(Py_None);
            obj = Py_None;
        }
    }
#endif
    if (obj != NULL && obj != &NULL_PY_OBJ)
        Py_DECREF(obj);

    if (obj == &NULL_PY_OBJ)
    {
        obj = NULL;
        PyErr_Format(PyExc_NameError, "name '%s' is not defined", name);
    }
    else if (obj == NULL && !PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "unknown problem with '%s'", name);

    return (obj != NULL) ? 0 : -1;
}

static int
VolumeAttributes_print(PyObject *v, FILE *fp, int flags)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)v;
    fprintf(fp, "%s", PyVolumeAttributes_ToString(obj->data, "",false).c_str());
    return 0;
}

PyObject *
VolumeAttributes_str(PyObject *v)
{
    VolumeAttributesObject *obj = (VolumeAttributesObject *)v;
    return PyString_FromString(PyVolumeAttributes_ToString(obj->data,"", false).c_str());
}

//
// The doc string for the class.
//
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
static const char *VolumeAttributes_Purpose = "This class contains the plot attributes for the volume plot.";
#else
static char *VolumeAttributes_Purpose = "This class contains the plot attributes for the volume plot.";
#endif

//
// Python Type Struct Def Macro from Py2and3Support.h
//
//         VISIT_PY_TYPE_OBJ( VPY_TYPE,
//                            VPY_NAME,
//                            VPY_OBJECT,
//                            VPY_DEALLOC,
//                            VPY_PRINT,
//                            VPY_GETATTR,
//                            VPY_SETATTR,
//                            VPY_STR,
//                            VPY_PURPOSE,
//                            VPY_RICHCOMP,
//                            VPY_AS_NUMBER)

//
// The type description structure
//

VISIT_PY_TYPE_OBJ(VolumeAttributesType,         \
                  "VolumeAttributes",           \
                  VolumeAttributesObject,       \
                  VolumeAttributes_dealloc,     \
                  VolumeAttributes_print,       \
                  PyVolumeAttributes_getattr,   \
                  PyVolumeAttributes_setattr,   \
                  VolumeAttributes_str,         \
                  VolumeAttributes_Purpose,     \
                  VolumeAttributes_richcompare, \
                  0); /* as_number*/

//
// Helper function for comparing.
//
static PyObject *
VolumeAttributes_richcompare(PyObject *self, PyObject *other, int op)
{
    // only compare against the same type 
    if ( Py_TYPE(self) != &VolumeAttributesType
         || Py_TYPE(other) != &VolumeAttributesType)
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

    PyObject *res = NULL;
    VolumeAttributes *a = ((VolumeAttributesObject *)self)->data;
    VolumeAttributes *b = ((VolumeAttributesObject *)other)->data;

    switch (op)
    {
       case Py_EQ:
           res = (*a == *b) ? Py_True : Py_False;
           break;
       case Py_NE:
           res = (*a != *b) ? Py_True : Py_False;
           break;
       default:
           res = Py_NotImplemented;
           break;
    }

    Py_INCREF(res);
    return res;
}

//
// Helper functions for object allocation.
//

static VolumeAttributes *defaultAtts = 0;
static VolumeAttributes *currentAtts = 0;

static PyObject *
NewVolumeAttributes(int useCurrent)
{
    VolumeAttributesObject *newObject;
    newObject = PyObject_NEW(VolumeAttributesObject, &VolumeAttributesType);
    if(newObject == NULL)
        return NULL;
    if(useCurrent && currentAtts != 0)
        newObject->data = new VolumeAttributes(*currentAtts);
    else if(defaultAtts != 0)
        newObject->data = new VolumeAttributes(*defaultAtts);
    else
        newObject->data = new VolumeAttributes;
    newObject->owns = true;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

static PyObject *
WrapVolumeAttributes(const VolumeAttributes *attr)
{
    VolumeAttributesObject *newObject;
    newObject = PyObject_NEW(VolumeAttributesObject, &VolumeAttributesType);
    if(newObject == NULL)
        return NULL;
    newObject->data = (VolumeAttributes *)attr;
    newObject->owns = false;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////

PyObject *
VolumeAttributes_new(PyObject *self, PyObject *args)
{
    int useCurrent = 0;
    if (!PyArg_ParseTuple(args, "i", &useCurrent))
    {
        if (!PyArg_ParseTuple(args, ""))
            return NULL;
        else
            PyErr_Clear();
    }

    return (PyObject *)NewVolumeAttributes(useCurrent);
}

//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef VolumeAttributesMethods[] = {
    {"VolumeAttributes", VolumeAttributes_new, METH_VARARGS},
    {NULL,      NULL}        /* Sentinel */
};

static Observer *VolumeAttributesObserver = 0;

std::string
PyVolumeAttributes_GetLogString()
{
    std::string s("VolumeAtts = VolumeAttributes()\n");
    if(currentAtts != 0)
        s += PyVolumeAttributes_ToString(currentAtts, "VolumeAtts.", true);
    return s;
}

static void
PyVolumeAttributes_CallLogRoutine(Subject *subj, void *data)
{
    typedef void (*logCallback)(const std::string &);
    logCallback cb = (logCallback)data;

    if(cb != 0)
    {
        std::string s("VolumeAtts = VolumeAttributes()\n");
        s += PyVolumeAttributes_ToString(currentAtts, "VolumeAtts.", true);
        cb(s);
    }
}

void
PyVolumeAttributes_StartUp(VolumeAttributes *subj, void *data)
{
    if(subj == 0)
        return;

    currentAtts = subj;
    PyVolumeAttributes_SetDefaults(subj);

    //
    // Create the observer that will be notified when the attributes change.
    //
    if(VolumeAttributesObserver == 0)
    {
        VolumeAttributesObserver = new ObserverToCallback(subj,
            PyVolumeAttributes_CallLogRoutine, (void *)data);
    }

}

void
PyVolumeAttributes_CloseDown()
{
    delete defaultAtts;
    defaultAtts = 0;
    delete VolumeAttributesObserver;
    VolumeAttributesObserver = 0;
}

PyMethodDef *
PyVolumeAttributes_GetMethodTable(int *nMethods)
{
    *nMethods = 1;
    return VolumeAttributesMethods;
}

bool
PyVolumeAttributes_Check(PyObject *obj)
{
    return (obj->ob_type == &VolumeAttributesType);
}

VolumeAttributes *
PyVolumeAttributes_FromPyObject(PyObject *obj)
{
    VolumeAttributesObject *obj2 = (VolumeAttributesObject *)obj;
    return obj2->data;
}

PyObject *
PyVolumeAttributes_New()
{
    return NewVolumeAttributes(0);
}

PyObject *
PyVolumeAttributes_Wrap(const VolumeAttributes *attr)
{
    return WrapVolumeAttributes(attr);
}

void
PyVolumeAttributes_SetParent(PyObject *obj, PyObject *parent)
{
    VolumeAttributesObject *obj2 = (VolumeAttributesObject *)obj;
    obj2->parent = parent;
}

void
PyVolumeAttributes_SetDefaults(const VolumeAttributes *atts)
{
    if(defaultAtts)
        delete defaultAtts;

    defaultAtts = new VolumeAttributes(*atts);
}

